<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div>
        <p>1</p>
    </div>
    <div>
        <p>2</p>
    </div>
    <div>
        <p>3</p>
    </div>
    <script src="../d3.js"></script>
    <script>
        // const selection = d3.select('div');
        //const selection = d3.selectAll('div');
        //const e = document.querySelector('div');
        //const selection = d3.select(e);

        //const selection = d3.create('input') ;

        const selection = d3.selectAll('div p');

        selection.each(function(d,i){
            //d 是后面要讲到的给元素绑定的数据(暂时忽略)
            //i 元素下标
            //this 就是当前元素
            console.log(d , i , this);
        })
        
    </script>
</body> 
</html>